The present invention relates generally to system and methods for testing reliability of software programs. More particularly, the present invention relates to a computer-aided software testing system and methods which assist a Quality-Assurance engineer and software developers with the testing of Graphical User Interface (GUI) software programs operative on digital computers.
Development of software is largely a trial and error process. Accordingly, substantial development resources are allocated to the process of finding "bugs"--errors occurring in the program being developed. Expectedly, there is keen interest in finding ways to improving the testing of software.
As software is developed on and runs on computers, it is not surprising to find that many of the techniques for automating the testing of software have been implemented in digital computers. A common approach for testing software is the use of test suites. Test suites compare "known good" outputs of a program (for a given set of input) against the current output. Tests that check program file output are easy to implement and can be automated with shell scripts (e.g., Expect available on the Internet). For programs with user interfaces that communicate to standard input/output devices (stdin/stdout), a similar method may be employed. Capture/playback tools are available for recording keyboard input and program output as a person tests a program.
Much of the code written today is for software products with a graphical user interface (GUI), such as Microsoft.RTM. Windows.TM.. In fact, much of software development itself is done within a graphical user interface, with software tool vendors providing products which allow software developers to develop GUI software using visual programming techniques. The Quality Assurance (QA) engineer faces more complex problems when testing GUI software. In particular, GUI programs must behave correctly regardless of which video mode or operating environment is being employed.
Intuitively, testing user interfaces should not be as difficult as testing a complex internal engine, such as a compiler or a real-time, multi-user operating system. In practice, however, user interface (UI) testing is the most challenging part of the QA process. This problem stems largely from the difficulty in automating UI tests. Tests for complex engines, in contrast, are often command-line programs whose testing can easily be automated using simple batch execution. Thus despite the plethora of present day tools for automating program testing, the task of developing, maintaining and analyzing the results of UI tests remains an arduous task.
The basic steps traditionally employed to test user interfaces may be summarized as follows. First, the application being tested is controlled by placing it into a specific state using either pre-recorded keyboard or mouse device actions, or entering input through a test script. Next, the then-current state of the application is recorded by taking a screenshot (e.g., capturing a screen bitmap). Finally, the captured screenshot is compared with a baseline screenshot that is known to be valid.
The approach is far from ideal, however. Consider, for instance, the determination of whether the state of a check box is valid within a specific dialog box. Here, the QA engineer must take a screenshot of that check box and compare it with the expected image. Thus, testing of even the simplest component is laborious. Moreover, the approach itself is prone to error. A change of just a few pixels across all windows--a common occurrence in GUI software development--causes all tests to fail. Consequently, as software becomes more and more complex, it becomes less and less feasible to test user interface tasks with present-day screen comparison methodology. A better approach is needed.